#include "branchstrcture.h"
#include <iostream>
using namespace std;

enum colorenum { red = 1, green = 5, blue = 6 };

BranchStrcture::BranchStrcture()
{

}

void BranchStrcture::show(){
    cout << endl << endl;
    cout << "分支结构==============================================="<< endl;

    // if
    {
        int i= 10;
        int j = 20;

        if(i>j){
            cout << "i大于j" << endl;
        }else{
            cout << "i不大于j" << endl;
        }
    }

    // Switch
    {
        cout << endl << endl;
        cout << "switch 判断枚举=================" << endl;
        colorenum coleType;
        coleType = red;
        switch (coleType) {
        case red:
          cout << "颜色为：red" << endl;
          break;
        case green:
          cout << "颜色为：green" << endl;
          break;
        default:
          cout << "颜色为：green" << endl;
          break;
        }
    }
}
